import finance.Institution 
import finance.InvestmentType 
import finance.User 
import finance.UserCashAccount 
import finance.Currency

class BootStrap {

     def init = { servletContext ->
     	(new User(user_name: 'qwerty', password: 'qwerty')).save()
     	(new User(user_name: 'asdfgh', password: 'asdfgh')).save()
     	
     	(new Currency(symbol: 'USD', name: 'US Dollar', rate_to_usd: 1, last_update: '04/01/2010')).save()
     	(new Currency(symbol: 'INR', name: 'Indian Rupees', rate_to_usd: 45, last_update: '04/01/2010')).save()
     	(new Currency(symbol: 'GBP', name: 'UK Pound', rate_to_usd: 0.75, last_update: '04/01/2010')).save()
     	
     	(new InvestmentType(name: 'CASH', table_name: 'user_bank_account')).save()
     	(new InvestmentType(name: 'CD / FD', table_name: 'user_cd_account')).save()
     	
     	(new UserCashAccount(user: User.get(1), name: 'UCO Savings 1', amount: 40000, currency: Currency.get(2))).save()
     	(new UserCashAccount(user: User.get(1), name: 'UCO Savings 2', amount: 60000, currency: Currency.get(2))).save()
     	(new UserCashAccount(user: User.get(1), name: 'Savings in USA', amount: 70000, currency: Currency.get(1))).save()
     }
     def destroy = {
     }
}